Replace ::getSelection with ::getLastSelection