checking for last file