added onComplete handler