fix memleak with subscriptions