Use before filter to load resources