fix OSX compilation
fix for empty dirs