fix array functions