added event listener for resize to fix the viewport