defend against npe