Fixed nullpointer expection