add restoreInitPosition function