add check for slice and rank