Rewrote controller