fixed restorePosition bug