Fix alarm bug