change to use wp rewrite