Add controller rewrite fucntion.