fix bugs, search, decode