Fix Undefined index when checking display switch