cleaned up javascript validations