merge errors correctly