NPE fix during xml parsing