fix det selection bug