protect against null pointer