fixing nullpointer