added input validation to service department