Fix threshold exception

related pull request to original repo:
https://github.com/berk/tr8n/pull/51