database structure error fixed