bug fixing on the selection