fixed loading order
added updateItem function