Change switch case, fixes #5781