fixed bug with selection