refine the NPE checking