fixes selection bug