fix selection bug