Adding thread implementation not proper