added alert for error checking