adjusting code for the new resource model