try setting on_finish to clean up loose connections