fixes flash on page change