Fixed a bug with selection