bug fixes and conn pooling