Customize the code for history view