Fix issue with resize event on mobile devices