remade the resources controller