making sure the size reading is correctly updated onload