Fixed to use log dir