Fix update loop by waiting for moveend event that apparently can fire async