writing current controller