sending error messages to client