adjust for Scala: outsideSql