use mina to rewrite