* added some error message and error handling
* implemented BuildErrorMsg
* sent message back to client