Implemented New logic for history