added check for tmp