better validation and errors