fix on page load bug