fixed recent bug with sorting atoms for GPUs