fix missing directory purge when output directory specified