fixed a bug in recompute