added onCompletion handler