fixing database accessor