better error handling, ignores 407 lines