Fix frame resize bug