stricter array check, thanks to wesley