better handling of record not found