Changed the alert message content and code re-factored