Function to insert item into bag