Added multiple error catching