check size of queue before remove