send error messages to client