fixed sql connectionm bug