Call onSuccess at the right time