handled some errors gracefully