enhance page load logic