fixed resizing bugs