fixed resize bug