make sure working and output directory exist