Program not downloading correct data