add null checks to parse routine