fixing up service function