cast to array or enforce proper type hint