fixed a bug with cache