thread.stop(); is deprecated, need to use another method to stop thread

Signed-off-by: Liew Zhao Wei <zhaoweiliew@gmail.com>