correcting NPE