fixed resizing bug