fix warning when switch spam