Added a resize function on page load to prevent the lagging on render.