moved isInitialized to a better place