move debug code, auto dump downloaded file to txt