use repository API instead temporary directory
use repository instead temporary directory