This line seems completely unrelated to this function.  Do you know if this can be moved to where last_item is defined?
(I originally wrote that code, but I currently don't see the need for this assignment to be done inside the init and add methods, perhaps a remnant from an earlier version).