fix index out of range on missing commands