added queue management task with tons of logic