Fixed error for changed database structure