Moved sizing functionality to onWindowResize