Function restoreFocus