Fixed issues with connection pool