rearranged onComplete implementation to clarify queue usage