add bencode and fix bug