Updated dynamic fineName creation, moved it inside of while loop