Fixes loading js only on page reload