Only add to history if command is successful