js solution for redirect