additional null pointer saftey checks