improved alarm handling