Fixed recursion in background processing