fix alarm loop race condition (maybe?)