added dir list testing and fixed bugs found in testing