add TeaCache and some bugs fixed