fixed buildRig