fix bad prior/next interactions between interrupt handling and the primary loop