Fixed to properly check if Notification object exists in window