Switch from try/except to while count(value) > 0

Update on #5