Fix logic, should be array first