js fixesto email and redirect