fix bug when regist window service