diff --git a/src/App.js b/src/App.js
index 651dfb8b03dacf425e0a0a6aebdf8f5373b4e441..19f086ba5b5a12b8598add2d4efd35480367d341 100644
--- a/src/App.js
+++ b/src/App.js
@@ -27,8 +27,10 @@ class App extends Component {
     let width = window.innerWidth;
     let height = window.innerHeight;
     this.state = { lam_points: Map(), mapSize: { width, height } };
-    get_lam_points("http://tie.digitraffic.fi", this.update_state.bind(this));
-    connect_lam_ws("ws://tie.digitraffic.fi", this.update_state.bind(this));
+    get_lam_points("http://tie.digitraffic.fi", this.update_state.bind(this))
+      .then(() => {
+        connect_lam_ws("ws://tie.digitraffic.fi", this.update_state.bind(this));
+      })
     this.handleResize = this.handleResize.bind(this);
   }