finished max record number handeling