alert function for showing user alerts