How to acess gameMode class from blueprintFunctionLibrary class

Hi,
How to acess gameMode class from blueprintFunctionLibrary class?

AMyGameMode* GameMode = (AMyGameMode*)GetWorld()->GetAuthGameMode();

This should work. Might need to include the headers for it too.