some changes, from https://github.com/oknoorap/tpljs/issues/1
Merge branch 'master' of https://github.com/oknoorap/tpljs
suggestion https://github.com/oknoorap/tpljs/issues/1