Rewrie to new security