execute setViewportSize multiple times to make sure viewport size is set properly