Add debugging code and code to make sure pages dont' repeat