fixed weird resize bug