add switch at correct place