fixed null pointer issue that came up in regression tests