Changing when cleanup is called

The code would error out on me if I used the didSucceed delegate message to start another PDF render.
I moved your cleanup code  to happen after the notification to avoid this.