fixed add_existing_path function