return the error message to the client on validation failure.
bug fix, support callback function.