fixed alarm handling