fixing javacript redirect