encode handle + cancel pdb