Moved a if branch, so there is no longer an error when not a modswitch