- Add a thread lock for GUI