fix reloading the page problem