fix possible null pointer