Added code

- Added code in controller and Thread classes(Test)