add try/catch. fix tests