fix the panel resize bug.