Fixes #541, onSuccess does not return value of callback