Replace die() with pdie() and err() macros