check null pointers