correctly handle errors

very cool