fixed bug in lengths_file permission 2