Properly join the elements of the sql, oops.