Fix subscribe/resubscribe bug