Gov. Andrew Cuomo and state lawmakers on Monday agreed to amend a bill that will create a commission to investigate misconduct by the state’s prosecutors based on concerns over the legislation’s constitutionality.

The amendment removes provisions of the bill that were thought to have violated the separation of powers between branches of state government, expanded the role of the judiciary beyond what’s in the state constitution, and possibly disrupted the work of the state’s prosecutors.