add onSuccess code flag