done writing code, working of fixing threads stuck