Cleaning up javascript to not show notice when page is loaded