fixed bug in database accessor