FIX: DIFFERENCE function - wrong results for stateless mode