returning null if no errors in file