fixed a memory leak with subscriptions