Add onSuccess callback function