added errorLocations and a few validations