1. exit on close;2. fix bug in CountSort