improve some of the validation