implement the onsize handler