The implementation is wrong. Try put here next
```
$form->onSuccess[] = function ($form, $values) use (& $types) {
	$types[] = $values instanceof ArrayHash;
};
```