changed lookup code to include recid