cast debug param, move mask out from get_pa