improve queue management and stop