rtTrace in callable program

rtTrace inside an RT_CALLABLE_PROGRAM is complied successfully however it fails in running the program.

error : Unknown Value when trying to figure out pointer space for ray payload argument to rt_trace at: [ i64 %4 … …}

I think that it might be related to the declaration of bindless callable program.

can you give a simple code with the right declaration ?
thanks.

the callable program looks:

RT_CALLABLE_PROGRAM void InternalTrace(const float3& vOrigin, const float3& vDir, Scene_PolishPRD& prdPolish, Scene_InternalPRD& prdInternal)
{

if ( !m_bIgnoreInclusions )
{
	if ( prdInternal.cInternalReflectionsCount <= m_cMaxIncReflections && prdInternal.eCurrHitType == Scene_InternalPRD::eMiss )
	{
		
		optix::Ray ray( vOrigin, vDir, RAYTYPE_SCENE_INTERNAL, m_fSafetyDist, prdPolish.fDist2NextFacet - m_fSafetyDist );
		rtTrace( INCLUSIONS_TOP_OBJECT, ray, prdInternal );

		
		if ( prdInternal.eCurrHitType != Scene_InternalPRD::eMiss )
		{
			prdInternal.fIntensityAtInclusion *= prdInternal.fOverallAccumulatedWeight * MaterialAttenuation( ray_intersection_dist );  	
			m_IDsBuffer[vLaunchIndex] = static_cast<int>( prdInternal.uInclusionID );
		}
	}
}

prdInternal.fOverallAccumulatedWeight *= MaterialAttenuation( prdPolish.fDist2NextFacet );

prdInternal.cInternalReflectionsCount++;

}

according to the guide I should add beforehand the next declarations:

rtDeclareVariable(rtCallableProgramId<void(const float3, const float3, Scene_PolishPRD, Scene_InternalPRD)>, InternalTrace);
rtBuffer<rtCallableProgramId<void(const float3, const float3, Scene_PolishPRD, Scene_InternalPRD)>, 0> InternalTrace;

however, with these declarations the compilation fails and without them the execution fails.