fix comparison of Scans, to minimize writing repeated scandefs to db