more null pointer checks