fixed edge case when there is no join