fixing the NPE in record reader