replaced for loop with filter HOF in unsubscribe