avoid possible NPE on error