fixed connection leaks