fix the len bug