Added getRecord function