update fetchOrInsert method