diff --git a/src/gui/peptide_detail_view/peptidewindow.cpp b/src/gui/peptide_detail_view/peptidewindow.cpp
index 6b2f2db7a515420c03a22afb14513ee2f8944719..8f3ff47f8da1bc8fe3413e9f34792c1391dc7fc2 100644
--- a/src/gui/peptide_detail_view/peptidewindow.cpp
+++ b/src/gui/peptide_detail_view/peptidewindow.cpp
@@ -28,15 +28,30 @@
 #include <pappsomspp/spectrum/qualifiedspectrum.h>
 #include <QMessageBox>
 #include <QSettings>
+#include <QDebug>
+
+
+void SpectrumSpLoaderThread::doLoadSpectrumSp (PeptideMatch * p_peptide_match) {
+    qDebug() << "SpectrumSpLoaderThread::doLoadSpectrumSp begin";
+    pappso::SpectrumSp spectrum = p_peptide_match->getIdentificationDataSource()->getSpectrumSp(p_peptide_match->getScan());
+
+    emit spectrumSpReady(spectrum, QString(""));
+    qDebug() << "SpectrumSpLoaderThread::doLoadSpectrumSp end";
+}
 
 PeptideWindow::PeptideWindow(ProjectWindow *parent):
     QMainWindow(parent),
     ui(new Ui::PeptideDetailView)
 {
+    qDebug() << "PeptideWindow::PeptideWindow begin";
     _p_project_window = parent;
     ui->setupUi(this);
     /*
     */
+    SpectrumSpLoaderThread * worker = new SpectrumSpLoaderThread;
+    worker->moveToThread(&_spectrum_loader_thread);
+    _spectrum_loader_thread.start();
+
 
     QSettings settings;
     QString unit = settings.value("peptideview/precision_unit", "dalton").toString();
@@ -47,7 +62,8 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent):
     } else {
         _p_precision = Precision::getPpmInstance(precision);
     }
-
+    
+    qRegisterMetaType<pappso::SpectrumSp>("pappso::SpectrumSp");
 #if QT_VERSION >= 0x050000
     // Qt5 code
     /*
@@ -59,8 +75,13 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent):
 // Qt4 code
     connect (_p_project_window, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
 
+    connect (this, SIGNAL(loadSpectrumSp(PeptideMatch *)), worker,SLOT(doLoadSpectrumSp(PeptideMatch *)));
+    connect (worker, SIGNAL(spectrumSpReady(pappso::SpectrumSp, QString)), this,SLOT(doSpectrumSpReady(pappso::SpectrumSp, QString)));
+
     //connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar()));
 #endif
+
+    qDebug() << "PeptideWindow::PeptideWindow end";
 }
 
 PeptideWindow::~PeptideWindow()
@@ -80,8 +101,8 @@ void PeptideWindow::updateDisplay() {
         ui->z_label->setText(QString("%1").arg(_p_peptide_match->getCharge()));
         ui->scan_label->setText(QString("%1").arg(_p_peptide_match->getScan()));
         ui->modification_label->setText(_p_peptide_match->getPeptideXtpSp().get()->getModifString());
-        
-        
+
+
     }
     catch (pappso::PappsoException exception_pappso) {
         QMessageBox::warning(this,
@@ -94,17 +115,29 @@ void PeptideWindow::updateDisplay() {
 
 }
 
-void PeptideWindow::setPeptideMatch(PeptideMatch * p_peptide_match) {
-    _p_peptide_match = p_peptide_match;
-    
-    SpectrumSp spectrum = _p_peptide_match->getIdentificationDataSource()->getSpectrumSp(_p_peptide_match->getScan());  
+void PeptideWindow::doSpectrumSpReady(SpectrumSp spectrum_sp, QString error) {
+    qDebug() << "PeptideWindow::doSpectrumSpReady begin";
     pappso::QualifiedSpectrum spectrum_copy;
     spectrum_copy.setPrecursorCharge(_p_peptide_match->getCharge());
-    spectrum_copy.setOriginalSpectrumSp(spectrum);
+    spectrum_copy.setOriginalSpectrumSp(spectrum_sp);
+
+    ui->spectrumWidget->setQualifiedSpectrum(spectrum_copy);
+
+    qDebug() << "PeptideWindow::doSpectrumSpReady end";
+
+}
 
-    pappso::PeptideSp peptide = p_peptide_match->getPeptideXtpSp();
+void PeptideWindow::setPeptideMatch(PeptideMatch * p_peptide_match) {
+    qDebug() << "PeptideWindow::setPeptideMatch begin";
+    _p_peptide_match = p_peptide_match;
+
+    qDebug() << "PeptideWindow::setPeptideMatch emit loadSpectrumSp(_p_peptide_match)";
+    emit loadSpectrumSp(_p_peptide_match);
+
+    pappso::PeptideSp peptide = _p_peptide_match->getPeptideXtpSp();
     ui->spectrumWidget->setPrecision(_p_precision);
     ui->spectrumWidget->setPeptideSp(peptide);
-    ui->spectrumWidget->setQualifiedSpectrum(spectrum_copy);
+
     updateDisplay();
+    qDebug() << "PeptideWindow::setPeptideMatch end";
 }
diff --git a/src/gui/peptide_detail_view/peptidewindow.h b/src/gui/peptide_detail_view/peptidewindow.h
index cddfc11ebc5054f6ee25d12362ded1322f96b4d6..1949d047c7e6f7c9e8e7f6c1205247f27ad32e04 100644
--- a/src/gui/peptide_detail_view/peptidewindow.h
+++ b/src/gui/peptide_detail_view/peptidewindow.h
@@ -25,7 +25,9 @@
 
 #include <QMainWindow>
 #include <QTextDocument>
+#include <QThread>
 #include <pappsomspp/mass_range.h>
+#include <pappsomspp/spectrum/spectrum.h>
 #include "../../core/peptidematch.h"
 #include "../../core/identificationgroup.h"
 
@@ -35,6 +37,26 @@ namespace Ui {
 class PeptideDetailView;
 }
 
+
+class SpectrumSpLoaderThread : public QObject
+{
+    Q_OBJECT
+public:
+
+
+public slots:
+    void doLoadSpectrumSp(PeptideMatch * p_peptide_match);
+
+signals:
+    void spectrumSpReady(pappso::SpectrumSp spectrum_sp, QString error);
+    
+protected:
+
+    void closeEvent(QCloseEvent *event);
+
+};
+
+
 class PeptideWindow: public QMainWindow {
     Q_OBJECT
 
@@ -47,10 +69,18 @@ public:
 public slots:
     void doIdentificationGroupGrouped(IdentificationGroup * p_identification_group);
     
+signals:
+    void loadSpectrumSp(PeptideMatch * p_peptide_match);
+    
+protected slots:
+    void doSpectrumSpReady(pappso::SpectrumSp spectrum_sp, QString error);
 protected :
     void updateDisplay();
 
 private:
+  
+    QThread _spectrum_loader_thread;
+    
     Ui::PeptideDetailView *ui;
     ProjectWindow * _p_project_window;
     PeptideMatch * _p_peptide_match = nullptr;