Fixed a problem with selection after deleting