fix null pointerexception