removed useless query in upsert