Fixed nullpointer Exception