added isInitialized function. slightly modified demo html