fixed a bug in the view render when caching is turned on