Function restoreElements