implementation of alarm feature