bug fix for redirect