#174 possibly fixed race condition in close