rewrite work on controller