replaced onLoad alert to an alert when a link is clicked