Fixed potentiall null pointer