new 2 fucntions to update last line reached on search