fix two issues in ServiceHandlerImpl