fix array cast