update join queries to be transaction aware