building alert logic