onCompletion is deprecated (and is actually broken)