Fixed redirect then edit file