fix nullpointer exception