add  reset and alert function