changing the logic to fixed number of resources to show