put entry_count in the right place
Merge pull request #159 from sbwdlihao/patch-4

put entry_count in the right place to properly record number of entries