fix uid in sql statements