fix db insert bug, and add req checking in torrent_download