Fixed UrlManager rules caching

Fixed UrlManager rules caching, variable which stores the cache key is overwritten in the loop below.