added length control