add log and change dir