Fix the substitute method so that it has a default transformer and this

object