fix resizing bugs