faster restore_stack