Fixed issue with selection oversteppign bounds