fix bug with passing in array