bug fix width detection

fixed issue when resizing appears because of scrollbar