added alarm mode