some bug in cmd_reg