fix some bugs template