Correcting potential NPE