fixed bug where files in directory entry where overwritten