flattening directory for trusted build