Buffer switching added