Fixed javascript redirect