replaced 'opts' with 'self.opts' when needed