fix bug in case of custom upgrade streams

bug was on line 192, where $signature contains signature of last stream processed by the foreach cycle at line 123 (so not necessarily signature of the core stream!)