fixed bug that was creating empty directories