Bugfix error on resize