Fixing bug to add item to a list