handle queue