Fixed resource creation when directory does not exist