error handling on bad searches and fixed timing bug