fix url problems and js window bugs