Fixed bug : Stopthread properly