fixed bug in adjusting minimum length