Fixed nullpointer
Fixed bug