I noticed that some some of your code can be a bit glitchy... I've not done enough investigation but I see you use the library https://github.com/BurntSushi/xgb which says:
Note that this project is largely unmaintained as I don't have the time to do
or support more development. Please consider using this fork instead:
https://github.com/jezek/xgb
I noticed that some some of your code can be a bit glitchy... I've not done enough investigation but I see you use the library https://github.com/BurntSushi/xgb which says: