fixed  some edge cases
assert => valueerrors