added alarm functionality