Added exception handler for datagrid index.