bugfix and adjust cache strategy