Adding nil check for xml content error