separated callback out into success and failure