fixing bug in service restart