fix problem with get position for sort