restored logging
Fixed alarm not firing in backgroud