add slot setResource.