How to secure thread 2