fix bug where setting a short timeout would prevent the timeout from triggering