fix database reference