Changes use to through instead of map and better error handling. Not crashing on uncaught errors.