diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index f6ed8b9..c8f8a34 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -247,9 +247,6 @@
    private ScrollerText mRadioTextScroller = null;
    private ScrollerText mERadioTextScroller = null;
 
-   /* Scanning frequencies */
-   ArrayList<Integer> mScannedFrequencies;
-
    private PresetStation mTunedStation = new PresetStation("", 102100);
    private PresetStation mPresetButtonStation = null;
 
@@ -571,7 +568,7 @@
         }
         try {
             if (!mService.isSearchInProgress()) {
-                resetSearch();
+                mServiceCallbacks.onSearchComplete();
             }
         }catch (RemoteException e) {
             e.printStackTrace();
@@ -1725,9 +1722,6 @@
       SharedPreferences.Editor editor = sp.edit();
       editor.clear();
       editor.commit();
-      if (mScannedFrequencies != null) {
-         mScannedFrequencies.clear();
-      }
    }
    public boolean fmConfigure() {
       boolean bStatus = true;
@@ -2088,13 +2082,19 @@
    }
 
    private void saveStations() {
-       if (mScannedFrequencies != null && mScannedFrequencies.size() > 0) {
-           Collections.sort(mScannedFrequencies);
+       List<Integer> scannedFrequencies = null;
+       try {
+           scannedFrequencies = mService.getScannedFrequencies();
+       } catch (RemoteException e) {
+           e.printStackTrace();
+       }
+       if (scannedFrequencies != null && scannedFrequencies.size() > 0) {
+           Collections.sort(scannedFrequencies);
            SharedPreferences sp = getSharedPreferences(SCAN_STATION_PREFS_NAME, 0);
            SharedPreferences.Editor editor = sp.edit();
 
            int index = 0;
-           for (Integer freq : mScannedFrequencies) {
+           for (Integer freq : scannedFrequencies) {
                index++;
                editor.putString(STATION_NAME + index, index + "");
                editor.putInt(STATION_FREQUENCY + index, freq);
@@ -3126,11 +3126,6 @@
          Log.d(LOGTAG, "mServiceCallbacks.onTuneStatusChanged: ");
          if (mIsScaning) {
              Log.d(LOGTAG, "isScanning....................");
-             if (mScannedFrequencies == null) {
-                 mScannedFrequencies = new ArrayList<Integer>();
-             }
-
-             mScannedFrequencies.add(FmSharedPreferences.getTunedFrequency());
          }
          cleanupTimeoutHandler();
          mHandler.post(mUpdateStationInfo);
@@ -3160,7 +3155,13 @@
       public void onSearchComplete() {
          Log.d(LOGTAG, "mServiceCallbacks.onSearchComplete :");
          if (mIsScaning) {
-             if (mScannedFrequencies != null && mScannedFrequencies.size() > 0) {
+             List<Integer> scannedFrequencies = null;
+             try {
+                 scannedFrequencies = mService.getScannedFrequencies();
+             } catch (RemoteException e) {
+                 e.printStackTrace();
+             }
+             if (scannedFrequencies != null && !scannedFrequencies.isEmpty()) {
                  mShowStationList = true;
              } else {
                  mHandler.post(new Runnable() {
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 12b9a0d..ee305dc 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -164,6 +164,7 @@
    private FMDeathRecipient mFMdr;
 
    //PhoneStateListener instances corresponding to each
+   private ArrayList<Integer> mScannedFrequencies = new ArrayList<Integer>();
 
    private FmRxRdsData mFMRxRDSData=null;
    // interval after which we stop the service when idle
@@ -2116,6 +2117,11 @@
          return(mService.get().isSearchInProgress());
       }
 
+      public List<Integer> getScannedFrequencies()
+      {
+         return(mService.get().getScannedFrequencies());
+      }
+
       public int getExtenCountryCode()
       {
          return(mService.get().getExtenCountryCode());
@@ -2451,6 +2457,10 @@
       return(bStatus);
    }
 
+   public List<Integer> getScannedFrequencies() {
+       return mScannedFrequencies;
+   }
+
    public boolean isSearchInProgress() {
       int state = mReceiver.getFMState();
       return state == qcom.fmradio.FmTransceiver.FMState_Srch_InProg;
@@ -2687,6 +2697,8 @@
     */
    public boolean scan(int pty)
    {
+      // Clear previously scanned frequencies
+      mScannedFrequencies.clear();
       boolean bCommandSent=false;
       if (mReceiver != null)
       {
@@ -3201,6 +3213,9 @@
             if(mReceiver != null) {
                clearStationInfo();
             }
+            if (isSearchInProgress()) {
+                mScannedFrequencies.add(frequency);
+            }
             if(mCallbacks != null)
             {
                mCallbacks.onTuneStatusChanged();
diff --git a/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl b/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl
index faa9c89..53ba0d6 100644
--- a/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl
+++ b/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl
@@ -76,6 +76,7 @@
     boolean isRtPlusSupported();
     boolean isA2DPConnected();
     boolean isSearchInProgress();
+    List getScannedFrequencies();
     boolean getIntfDetLowTh();
     boolean getIntfDetHighTh();
     boolean getRxRepeatCount();
