fix maxCount bug