avoid null pointer dereference