make sure the path is resumed in case of an error.

make sure the path is resumed in case of an error.