call asArray() instead of assign directly

fixes #3891