add rewrite controller