Fixed SQL disconnect problem