null check for self.document