Got history working
Fix bug