bug fixing: check mode name