fix issue with association errors when database is empty