fix cache max count bug