onResize error work around