split history into saveHistory and getHistory
saves to history when no console available