fix selection inversion operation