update the viewport resize function