Fixed trying to use function return directly as array