fixed bug with empty tmp directory