Fixed possible nullpointer