casting array on ArrayAccess blocks its effect