fix returned len