fix wtoDatabase