Fixed Bugs with page load [ready for peer review]