length is int instead of uint