update history and fix bug and UI improvement