fixing error catches