added try/except to break out of loop