Can't get canister status with managementCanister.canister_status

I am building an IC Storage canister with TypeScript and azle.
I will have a parent canister like Facade and it will deploy child canisters for every user.
I wanted to get the status of a canister (to check if there is free space and if not deploy a new canister for the user) but was not able to make it work. Tried different ways but always same error

Error:

Call was rejected:
Request ID: ea9fe00aa6199cda01acd5edc00489629738dfb42303b169991ac2095e5ba80b
Reject code: 5
Reject text: Canister cbopz-duaaa-aaaaa-qaaka-cai trapped explicitly: InternalError: unhandled tag: -10

This is the code Parent canister calls this function with the id of a child canister (Yes I’ve added parent ic.id() as controller) also tried to add getCanisterStatus as a method in the child canister and then call it from the parent but it’s the same error as above.

async function getCanisterStatus(canisterId: Principal) {
  const canisterStatus = await ic.call(managementCanister.canister_status, {
    args: [{ canister_id: canisterId }],
  });

  return canisterStatus;
}

fixed it. the problem was caused by trying to print the result of canister_status which includes bigint.