get rid of all possible similar null pointer race conditions