fixed bug in lengths_file permission