fixed non-custodial bug