fix resize() issue