Fixed error when valueError is returned rather than validation error