fixed to not create empty directory