fix selection with copy and paste