adding an unsubscribe function