fixed drawing issues on resize