create and delete output directory