fix the bug when learning commands