Adding page error handling