working on switch control