Adding try excpet statement on configuration block