would be good to add the panic() here too to ensure the bookeeping works properly.