Added proper isInitialized() function