(Bloomberg) -- Indonesia’s President Joko Widodo must amend parts of his omnibus law, which was meant to create jobs by overhauling investment regulations.

The changes must be done within two years or the law would be deemed unconstitutional, said Anwar Usman, chief judge at the constitutional court, after the Thursday ruling. The panel of judges rejected calls for the entire law to be canceled and the law is still in force until the revisions are made. The court hasn’t explained what changes it has ordered.

The bill has been dogged with controversy since it was first announced in 2019, with workers and investors raising concerns over labor rights and environmental protection. Jokowi, as the president’s known, is banking on the law to cut red tape and bring in investments that would create jobs, including through a new wealth fund included in the regulation.

©2021 Bloomberg L.P.