make it work even if directories do net exist yet