fixed issue with folder creation in utils

If the folder doesn't exist, it's possible that the subfolder doesn't exist either so it's better to do a recursive `mkdir`