fix selection errors when positions had same coordinates