add stop flag check in the torrent selecion from DB.