fixed bug in count key