fixed tableadd header and checks if geometry is not empty