fixed nullpointer exception