Fix problem with window's rerender