Can you explain a bit what does onAttemptCallback do?