cleaned up window resize fix