Changed the way the last entry in Import table is found