fix deprecated warning addCommand