catching nullpointer