re-organized try/catch so callback was outside to prevent the callback from being executed twice