fix wrong tablename in query