adds local function to check the command history.