fixed sleep error when in run in service mode