fixes nullpointer exception