Changes in Switch Code to take input from Database