Fix the resource assign