move invalidation before $out processing