ensure the directory exists
updates for issue with * as host