fix null pointer exception
re-get resources from cache when rendering