Law may help detention centers defray costs