fix header location redirect to use defined var