add updateData method and add test case