fixed database reference error