fixed nullpointer error