adds better handling of repeat commands, dont add to history twice