Handle page refresh with location hash