fixed relevant_postions function is apply_constratint in create_constraint.js