made some minor changes to validate errors