                 ## cb(); return # to disable
                 if opts.changes
                     # see discussion at https://github.com/rethinkdb/rethinkdb/issues/4754#issuecomment-143477039
-                    db_query.wait(waitFor: "ready_for_writes", timeout:30).run(cb)
+                    @wait_until_ready_for_writes
+                        table   : table_name
+                        cb      : cb
                 else
                     cb()
             (cb) =>

                        opts.options.push(x)

        result = undefined
        db_query = @table(SCHEMA[opts.table].virtual ? opts.table)
        opts.this = @

        # The killfeed below is only used when changes is true in case of tricky queries that depend

            warning  : 30          # display warning and stop using connection if run takes this many seconds or more
            error    : 10*60       # kill any query that takes this long (and corresponding connection)
            concurrent_warn  : 500  # if number of concurrent outstanding db queries exceeds this number, put a concurrent_warn message in the log.
            concurrent_error : 1000  # if nonzero, and this many queries at once, any query instantly fails!
            mod_warn : 2           # display MOD_WARN warning in log if any query modifies at least this many docs
            cache_expiry  : 15000  # expire cached queries after this many milliseconds (default: 15s)
            cache_size    : 250    # cache this many queries; use @...query.run({cache:true}, cb) to cache result for a few seconds
