Fixed racing condition bug in TUPT control