Added onComplete for success and failure handling