newQuery works with join