Fixed Undefined offest in Switch.php