chrome removed getSelected, so changed a little bit