use length for collection instead of size