convert map to array
cleanup