fix bug in virtualConstraint