handle changing viewport size