fix some template editor bug