call javascript on ui thread