rewrote test
throw error if code is not EEXIST