proper resize and fixed quit