improve validate