Fix to array function