fixed the model construction, cache is broken though