diff --git a/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index 2da7036..c82587b 100644
--- a/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -70,14 +70,15 @@
         mInputView = inputView;
     }
     
-    void makeKeyboards() {
+    void makeKeyboards(boolean forceCreate) {
+        if (forceCreate) mKeyboards.clear();
         // Configuration change is coming after the keyboard gets recreated. So don't rely on that.
         // If keyboards have already been made, check if we have a screen width change and 
         // create the keyboard layouts again at the correct orientation
         int displayWidth = mContext.getMaxWidth();
         if (displayWidth == mLastDisplayWidth) return;
         mLastDisplayWidth = displayWidth;
-        mKeyboards.clear();
+        if (!forceCreate) mKeyboards.clear();
         mSymbolsId = new KeyboardId(R.xml.kbd_symbols);
         mSymbolsShiftedId = new KeyboardId(R.xml.kbd_symbols_shift);
     }
diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java
index 6ee9bd1..8c9102d 100644
--- a/src/com/android/inputmethod/latin/LatinIME.java
+++ b/src/com/android/inputmethod/latin/LatinIME.java
@@ -210,16 +210,16 @@
     public void onConfigurationChanged(Configuration conf) {
         if (!TextUtils.equals(conf.locale.toString(), mLocale)) {
             initSuggest(conf.locale.toString());
-            if (mKeyboardSwitcher == null) {
-                mKeyboardSwitcher = new KeyboardSwitcher(this);
-            }
-            mKeyboardSwitcher.makeKeyboards();
         }
         // If orientation changed while predicting, commit the change
         if (conf.orientation != mOrientation) {
             commitTyped(getCurrentInputConnection());
             mOrientation = conf.orientation;
         }
+        if (mKeyboardSwitcher == null) {
+            mKeyboardSwitcher = new KeyboardSwitcher(this);
+        }
+        mKeyboardSwitcher.makeKeyboards(true);
         super.onConfigurationChanged(conf);
     }
 
@@ -228,7 +228,7 @@
         mInputView = (LatinKeyboardView) getLayoutInflater().inflate(
                 R.layout.input, null);
         mKeyboardSwitcher.setInputView(mInputView);
-        mKeyboardSwitcher.makeKeyboards();
+        mKeyboardSwitcher.makeKeyboards(true);
         mInputView.setOnKeyboardActionListener(this);
         mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT, 0);
         return mInputView;
@@ -236,7 +236,7 @@
 
     @Override
     public View onCreateCandidatesView() {
-        mKeyboardSwitcher.makeKeyboards();
+        mKeyboardSwitcher.makeKeyboards(true);
         mCandidateViewContainer = (CandidateViewContainer) getLayoutInflater().inflate(
                 R.layout.candidates, null);
         mCandidateViewContainer.initViews();
@@ -253,7 +253,7 @@
             return;
         }
 
-        mKeyboardSwitcher.makeKeyboards();
+        mKeyboardSwitcher.makeKeyboards(false);
 
         TextEntryState.newSession(this);
 
