Added additional error handling to search pages