use `discard` instead of `remove`in the `missing_paths` set