removed some unnecessary variables in handleWindowResize