fix database callback