change algorithm in checkNotification