Checks for sub variable when  switch is called