avoiding npe