fixed bugs by cache