working on an alert function