fixed arraylist to array conversion