Fix resizing bug