added basic type validation to arrays