change error type checks from deepEqual