fixed bug with selecting