Fixed a bug on the temp folder creation (wrong permission) and moved the check away from the costruction (now it's called only when needed)