Fixed dynamically fetching resource logic.