# CodeInUse (/docs/errors/chain/CodeInUse)

`remove_code` was refused because at least one contract instance still references the code hash. Check the code's reference count and terminate or `set_code` the contracts using it before removal.

Declared by the `Contracts` pallet; it classifies to the semantic code [`invalid_argument`](/docs/errors/invalid-argument).

## Remediation [#remediation]

Check the argument values against the operation schema

The same explanation is available in the terminal: `btcli explain CodeInUse`.
