for length autodetect