no more bug when resizing