Fixed bug for redirect