Better error handling of Record not found