level switching added