my explosion animation is stuck on last frame rather then getting destroyed after finishing

so im new to game making and stuff and i am trying to make this simple space shooter game. when i fire bullet hit the target destroys it and explosion animation is played but the last frame is stuck on the screen rather then completely disappearing. for animation im using a prefab here is my script for enemy:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Enemy : MonoBehaviour {

    public int health = 100;

    public GameObject deathEffect;

    public void takeDamage(int damage)
    {
        health -= damage;

        if (health <= 0)
        {
            die();
        }
    }


    void die()
    {
        Instantiate(deathEffect, transform.position, Quaternion.identity);
        Destroy(gameObject);
    }
}

This video at 4:33 min explains how to fix it https://www.youtube.com/watch?v=iTHEXMF0hpc

I had the same problem and came across this post which had no answers and is an old post but someone else with same problem might see this which is why I’ll leave this answer here. Hope it helps.