Fix bug in page load