correcting the reload javascript