check error in mkdtemp()