Fix to avoid problem while getting last command id.