JS reload not fully working