make sure directory exists before placing files