Bug fix. Fixing the DB query for mutiple IDs.