added function to list traiing directories