handles the record not found error