fix potentional race in issueCommand.