fix bug in trex.py and update uuid generator