Fix bug not hanging when not install as system service