add alarm code noblocking