add test and fix cancel command