added check if arraytype