was selecting the wrong part of the file for naming