fix: cm is not a global variable