Fixed global isLoaded var