Added the search for last line of the txt file