Bug fix for history