Moved handleSwitch from show card functions