better array check