New function to add dirs to z index.