modified for alarm