fix target orders between compile and restore