fixed possible null pointer