changed npe catch