Added additonal trap so the app exits properly