unhandled exception when sorting