fixed join queries