fix sql connection bug