Adding error handling

Added some error handling.
search loop tested (one bug: doing 1 extra related search after total
daily points reached).