add saveAlert and sendAlert function