fix bugs about selection