Tried to fix getNewData function. Didn't work