declare stop thread func