fix get parent directories in the list