removing unecessary code + bug fix in join clauses