changed setExtremes to afterSetExtremes