added alert function