fixed nullpointer exeption