Add a destroyed function to stop subscription