bugfix: joins are now correctly handled