Fixed undefined count