fixed nullpointer ex