Add exception and remove pdb