fixed #195: Error on resize