added dynamic resizing of canvas on window resize