finish fixing bug of using mssql