added check to create tmp folder when not available