fix to close connections correctly
v0.3.2