set up error catches