Moving main resize to outside function

need to call the rezise on page load