better error handling
filter out some bad results