updated for multi-output building
fixed bug in multi-build script