Wrote javascript code which removes incorrect email alert before creating new one when user presses submit button again