fixed history bug where it crashed if no previous was there, now currently have bug where it doesnt update history.txt