handled a few errors