changed setData to getData to avoid infinite loop