added query join and group support