Fix connection pool problem

Closes #1