added the first part of the alert function