handle array shape