bug fix for duplicate command that doesn't behave like the native command when using selections