Fixing bug in `get_new_path` function.

Reference to `i` should have been `attempt`.