fixed resize bugs