update next and temp queue immediately