updated login
added error handling in .search