change Notifier and add sleepFlag