Added check for empty joint table