Added updateData function