Sql warning fix