close connections after opening them