Fix sql error from tagged_with