Change doc to self.__dict__ for insert