fix check of nextContainer