added error handling and search box clears automatically after search is made