handle null pointer; prevent crash;