fix sendError usage