Syntax correction (should use self.doc instead of self.view)