Insert conditions to call the callback