getting the rewrite to work