add alert logic