Fixed fetchItems function