Added error checking for page parameters