Fixed Bug in switch