Fix bug in adding items to list