tried apply_constraints fix