fix bug when listing commands