fixing instance of $self and $class since we no longer protect them by adding a block