fixed mergeErrors for case when errors is null