small bug in unsubscription function