Changed JS function for reloading the page