cmd_type is returning the corect code