Fix a bug in deleting object tables query