better validation handling