fix bug about running service in onPause state