exception handlling code added and config changes made