changed .count to .size to support legacy ruby