                 request-f (js/XMLHttpRequest.)]
             (.open request-v "GET" vert true)
             (.open request-f "GET" frag true)
-            (aset request-v "onload" (fn [] (reset! atm-v (aget request-v "response"))))
-            (aset request-f "onload" (fn [] (reset! atm-f (aget request-f "response"))))
+            (set! (.-onload request-v) (fn [] (reset! atm-v (aget request-v "response"))))
+            (set! (.-onload request-f) (fn [] (reset! atm-f (aget request-f "response"))))
             (.send request-v)
             (.send request-f)
             [(atom nil) atm-f atm-v])))

    (do
      (aset glc "viewportWidth" (aget canvas "width"))
      (aset glc "viewportHeight" (aget canvas "height"))
      (.enable glc (aget glc "DEPTH_TEST"))
      (.clearColor glc 0.0 0.0 0.0 1.0)
      (.enable glc (aget glc "DEPTH_TEST"))
      (.depthFunc glc (aget glc "LEQUAL"))
      glc)
    (do
      (util/log "Unable to load webgl context. Your browser may not support it.")

  (let [tex (.createTexture gl)
        image (js/Image.)
        atm (atom false)]
    (set! (.-src image)  url)
    (set! (.-onload image) (fn []
                             (handle-tex-loaded image tex)
                             (reset! atm true)))
    [tex atm]))
