modify count method.