exception handling for index