writing snooze function