fixed display bug, implemented compensation for window resize