Fix bug - use length