Added if conditional and alert for the user.