Updated example to work with bad data