fix switch related concerns