fixing the check for error message on reply.