History trace function added,and fix some bug in temp history~