validation, a lot of fixes