fixed a resize bug