resizing: bug fixing