change if to switch-case
fix Config