fixed bug in SelectionManager