Fixed deprecated scoped function replace by where(nil)