fixed bug with history refreshing too much. Closes #62.