fix database issue