added cancel alarm check for automaticlly alarm.