updating pageVisibility and legacy