more js validations to clear alerts on back button