tried to fix nullpointer exception