added mains controller