Better way to check if the record exists