TS Gateway Locking Issue Fix

Fix locking with TS Gateway