bug fixed for exception sorter