Added missing error catches