Fixed possible null pointer