avoid nullpointerexception