changed die() to exit()