added checks to update data