fix problem with multiple passes
update build to handle external dependency