fixed infinite browser loop