fix precalculate