Rewrote item adding to better handle all cases and prevent items being added incorrectly