added switch logic