fix database handling of wt%