fixed a bunch of issues related to scope when using deferred and trying to override a method