add history, still buggy