Fixed threading error message at end of execution, adapted from commit klrkdekira/sinar-beacon@46af88fc4cb614d6c5e83ec26db95dd85e4b404d