Fixing auto resizing on window resize