fixed redundant Resize function