somehow the item.platforms = []; got changed to item.platforms = type; which screwed everything up.