deal with commands from history