Help with MainModule stuff

So, I have this script right here:

When the I join a game, the GUI clones into my PlayerGui, but when I leave and join back it gives me an error in console:

Are there any reasons why this is happening and how could I fix it? Also, I changed the gui name so it’s no longer CoreGui but it’s Home.

Fixed it myself, I needed to clone the GUI first.