added fixes for switches