fix database fail